
var api = require("../../../utils/api.js");
Page({
    data: {
        pageNum: 1,
        searchlist: [],
        play: !1,
        false: !1,
        active: "a",
        showEmpty: !1
    },
    onLoad: function(a) {
        // var t = this;
        api.default.config().then((a)=>{
           this.setData({info:a.data})
        });
    },
    onReady: function() {},
    onShow: function() {},
    init: function() {
        this.setData({
            pageNum: 1,
            active: n.globalData.active
        }), "a" == n.globalData.active ? this.getBrandInfoList() : this.search(this.data.pageNum);
    },
    search: function(a) {
        wx.setNavigationBarTitle({
            title: "精彩活动"
        });
        var t = this, i = {
            page: a,
            size: 10
        };
        e.default.getAPI("/activity/searchByPage", i, "get", function(e) {
            wx.hideNavigationBarLoading(), 1 == a && wx.stopPullDownRefresh(), t.setData({
                searchlist: e.data.list,
                showEmpty: 0 == e.data.list.length
            });
        });
    },
    activity: function(a) {
        t.toImageDetail(a.currentTarget.dataset.lick);
    },
    getBrandInfoList: function() {
        var a = this, t = n.globalData.sync;
        if (t.referrerInfo) o = {
            brandNo: 25001,
            source: t.scene,
            appid: ""
        }; else var o = {
            brandNo: 25001,
            source: t.scene,
            appid: t.referrerInfo.appIdrrerInfo
        };
        wx.setNavigationBarTitle({
            title: "关于我们"
        }), e.default.getAPI("/brandinfo/getBrandInfoList", o, "get", function(t) {
            wx.hideNavigationBarLoading(), a.setData({
                getBrandInfo: t.data.list[0],
                jsonData: JSON.parse(t.data.list[0].fileList),
                article: i.wxParse("article", "html", decodeURIComponent(t.data.list[0].content), a, 0)
            });
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        wx.showNavigationBarLoading();
        this.setData({
            pageNum: 1
        }), this.search(1);
    },
    onReachBottom: function() {
        wx.showNavigationBarLoading();
        var a = this.data.pageNum + 1, t = this, i = {
            page: a,
            size: 10
        };
        e.default.getAPI("/activity/searchByPage", i, "get", function(e) {
            wx.hideNavigationBarLoading();
            var i = t.data.searchlist;
            setTimeout(function() {
                e.data.list.forEach(function(a) {
                    i.push(a);
                }), t.setData({
                    searchlist: i,
                    pageNum: a
                });
            }, 500);
        });
    },
    onShareAppMessage: function() {}
});